<!--
Copyright 2010 WebDriver committers
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>locator_test.html</title>
  <script src="test_bootstrap.js"></script>
  <script type="text/javascript">
    goog.require('bot');
    goog.require('bot.ErrorCode');
    goog.require('bot.locators');
    goog.require('webdriver.ie');
    goog.require('goog.testing.jsunit');
  </script>

  <script type="text/javascript">
    function testFindingElementsWithInvalidClassNameThrows() {
      try {
        webdriver.ie.findElements("className", "!@#$%^&*");
        fail('Should not have succeeded because the class contained '
            + 'invalid characters');
        } catch (ex) {
          // We expect an exception because class name contained an
          // invalid character.
          assertEquals(bot.ErrorCode.INVALID_SELECTOR_ERROR, ex.code);
        }
    }

</script>
</head>
<body>
  <p id="x" name="para">Para</p>

  <div name="after" id="wrong" class="feline cats">nope</div>
  <div name="right" id="after" class="dogs">yup</div>
  <div name="lion" class="cats">simba</div>
  <div name="tiger" class="cats">shere khan</div>
  <div id="dotted_1" class="name.with.dots">dotted class</div>
  <div id="dotted_2" class="name.with.dots">another dotted class</div>

  <form action="#">
    <input name="after" /><br />
    <input name="foo" />
  </form>

  <!-- This comment should be ignored -->

  <span name="foo">Furrfu</span>

  <ul>
    <li id="illegal">item
    <li id="illegal">item
    <li id="illegal">item
    <li id="illegal">item
  </ul>

  <a id="link" href="#">this is a link</a>
  <a name="fishsticks">this is a link</a>
  <a href="#">this is a link</a>
  <a href="#">this is a link</a>
  <a href="#">this is a link</a>

  <a href="#">unrelated</a>
  <a href="#" id="empty-link"></a>
  <a href="#" id="comma-in-alt" alt="has, a comma">has, a comma</a>
</body>
</html>
